<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/vue.js"></script>
</head>
<body>
<div id="app">
    <!--使用组件-->
    <h2>pig</h2>
    <my-component></my-component>
    <my-component2></my-component2>
</div>
<script>
    Vue.component("my-component",{
        template:"<div>全局组件</div>"
    });
    let child={
        template:"<div>局部组件</div>"
    }
    let app=new Vue({
        el:'#app',
        data:{},
        components:{
            "my-component2":child
        }
    })
</script>
</body>
</html>